package game.items;

import edu.monash.fit2099.engine.actions.ActionList;
import edu.monash.fit2099.engine.actors.Actor;
import edu.monash.fit2099.engine.items.Item;
import edu.monash.fit2099.engine.positions.GameMap;
import game.actions.DrinkAction;

/**
 * A portable bottle that allows up to 5 drinks. Each drink gives +4 Hydration.
 */
public class Bottle extends Item {

    private int charges = 5;

    public Bottle() {
        super("Bottle", 'o', true);
    }

    public boolean hasCharge() {
        return charges > 0;
    }

    public void consumeCharge() {
        if (charges > 0) charges--;
    }

    @Override
    public ActionList allowableActions(Actor owner, GameMap map) {
        ActionList list = new ActionList();
        if (hasCharge()) {
            list.add(new DrinkAction(this));
        }
        return list;
    }
}
